/* GUI CONVERTED from rcsddel.p (converter v1.75) Sat Aug 12 23:01:33 2000 */
/* rcsddel.p - Customer Schedules : Delete sod_det in Ship-From db      */
/* Copyright 1986-2002 QAD Inc., Carpinteria, CA, USA.                  */
/* All rights reserved worldwide.  This is an unpublished work.         */
/*F0PN*/ /*V8:ConvertMode=Maintenance                                   */
/*K1Q4*/ /*V8:WebEnabled=No                                             */
/* REVISION: 7.3    LAST MODIFIED: 08/13/93           BY: WUG *GE19*    */
/* REVISION: 7.3    LAST MODIFIED: 04/11/95           BY: ame *F0QB*    */
/* REVISION: 7.3    LAST MODIFIED: 08/02/95           BY: bcm *G0TB*    */
/* REVISION: 8.6    LAST MODIFIED: 05/20/98           BY: *K1Q4* Alfred Tan */
/* REVISION: 9.1    LAST MODIFIED: 08/12/00           BY: *N0KP* myb        */


      /* DELETE A SO LINE ITEM RECORD */

/*F0QB*/  {mfdeclre.i}
      define input parameter sod_recid as recid.

/*F0QB*   {mfdeclre.i}*/
      define variable old_db as character.
/*F0QB*/  define variable sdb_err as integer no-undo.

/*G0TB*/  /* WE NEED TO USE THE sod_det INFORMATION SINCE THE HEADER
         SITE REPRESENTS THE AR SITE IN CUSTOMER SCHEDULES */
      find sod_det where recid(sod_det) = sod_recid no-lock.
/*G0TB*/  find si_mstr where si_site = sod_site no-lock.

/*G0TB**  find so_mstr where so_nbr = sod_nbr no-lock.  **/
/*G0TB**  find si_mstr where si_site = so_site no-lock. **/

      if si_db <> global_db then do:
         old_db = global_db.
/*F0QB*      create alias qaddb for database value(si_db).*/
/*F0QB*      global_db = si_db.*/
/*F0QB*/     {gprun.i ""gpalias3.p"" "(input si_db, output sdb_err)"}
/*GUI*/ if global-beam-me-up then undo, leave.


         {gprun.i ""rcsddela.p"" "(input sod_nbr, input sod_line)"}
/*GUI*/ if global-beam-me-up then undo, leave.


/*F0QB*      create alias qaddb for database value(old_db).*/
/*F0QB*      global_db = old_db.*/
/*F0QB*/     {gprun.i ""gpalias3.p"" "(input old_db, output sdb_err)"}
/*GUI*/ if global-beam-me-up then undo, leave.

      end.

      {gprun.i ""rcsddela.p"" "(input sod_nbr, input sod_line)"}
/*GUI*/ if global-beam-me-up then undo, leave.

